package cn.wlinker.video.monitor.brand.hikversion;


import cn.hutool.extra.spring.SpringUtil;
import cn.wlinker.video.monitor.brand.hikversion.create.EZOpenStreamServiceImpl;
import cn.wlinker.video.monitor.brand.hikversion.create.ISecureStreamServiceImpl;
import cn.wlinker.video.monitor.brand.hikversion.create.NetStreamServiceImpl;
import cn.wlinker.video.monitor.enums.VideoBrandEnum;
import cn.wlinker.video.monitor.service.IVideoAccessPlatformEnum;
import cn.wlinker.video.monitor.service.IVideoBrandEnum;
import cn.wlinker.video.monitor.service.IVideoStreamService;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 海康威视的取流枚举
 * @author gxsjx
 * @version 1.0
 * @date 2022/7/26
 */
@AllArgsConstructor
@Getter
public enum HikVisionAccessPlatformEnum implements IVideoAccessPlatformEnum {

    /**
     * 萤石云（ezopen）
     */
    ezopen("ezopen") {
        @Override
        public IVideoStreamService getFactory() {
            return SpringUtil.getBean(EZOpenStreamServiceImpl.class);
        }
    },
    /**
     * 综合安防平台（iSecure）
     */
    iSecure("iSecure"){
        @Override
        public IVideoStreamService getFactory() {
            return SpringUtil.getBean(ISecureStreamServiceImpl.class);
        }
    },
    net("net"){
        @Override
        public IVideoStreamService getFactory() {
            return SpringUtil.getBean(NetStreamServiceImpl.class);
        }
    };

    private final String accessPlatform;



    static {
        IVideoAccessPlatformEnum.register(HikVisionAccessPlatformEnum.values());
    }
    public static void init(){}

    @Override
    public IVideoBrandEnum getVideoBrandEnum() {
        return VideoBrandEnum.hk;
    }
}
